home *** CD-ROM | disk | FTP | other *** search
/ BMUG PD-ROM A / PD-ROM A.iso / Programming / Programming Languages / MacOberon / MacOberon (tools) / Elem.Guide.Txt (.txt) < prev    next >
Encoding:
Oberon Text  |  1991-02-14  |  21.2 KB  |  253 lines  |  [.Ob./.Ob2]

  1. Syntax10.Scn.Fnt
  2. Syntax14m.Scn.Fnt
  3. Syntax12m.Scn.Fnt
  4. Syntax10i.Scn.Fnt
  5. Syntax10b.Scn.Fnt
  6. Documentation of Write Elements
  7. Last Update: 22 Jan 91    (C. Szyperski, Ed.)
  8. Table of Contents
  9.         Element    Author    Last Update
  10.         Chart Elements    C. Pfister    14 Dec 90
  11.         Clock Elements    M. Franz    
  12.         Error Elements    C. Szyperski    22 Jan 91
  13.         Fold Elements    H. M
  14. ssenb
  15.         Graphic Elements    C. Szyperski    22 Jan 91
  16.         Icon Elements    R. Griesemer    
  17.         Line Elements    C. Szyperski    22 Jan 91
  18.     *    Picture Elements    H. Marais, K. Rege    
  19.         Popup Elements - "Hypertext without Surprises"    M. Franz    
  20.         Style Elements    C. Szyperski    22 Jan 91
  21.         Table Elements    C. Szyperski    22 Jan 91
  22. (*  to be released soon)
  23. This documentation is a periodically updated collection of sections describing fully independent Write elements. Each section is divided into two subsections: A textual introduction into the functionality of the particular elements, followed by a list of supported commands. For each command, the command name, its explicit and implicit parameters are given. Potential implicit parameters are the caret, selections, and the marked viewer. Explicit parameters are described using a compact syntax explained in the tutorial Write.Guide.Txt. At the end of each section a list of required files is given.
  24. E-mail update requests to the editor. Implementations of useful new Write elements are always welcome.
  25. Companion documentation:
  26.     Write.Guide.Txt - Tutorial and Release Notes
  27.     WriteReport.Txt - Guide for Implementors of new Write Elements
  28. Chart Elements
  29. Chart Elements may be used to create bar charts. Starting from a tilde-terminated list of numbers, each preceded by a backslash, a set of rectangular elements is created. This can in turn be used to design simple bar charts with horizontal or vertical bars. Sample texts that have been created using Chart Elements are available as ChartElems.Txt and BenchCharts.Txt.
  30. command    explicit parameters    implicit parameters
  31. ChartElems.Create    ("width" | "height") number    selection
  32. Starting from the most recent selection, the text is scanned until a "~" is found. All numbers prefixed with a backslash are replaced by a chart element. Everything else remains untouched.
  33. Clock Elements
  34. Analog clocks elements displaying the current time (whenever the machine is idle).
  35. command    explicit parameters    implicit parameters
  36. ClockElems.Insert    [number]    caret
  37. Insert a clock (with radius given in pixels, default is 32, minimum is 12) at the caret position.
  38. Error Elements
  39. When using Write to edit programs, Error elements can be used to translate error lists produced by a compiler into special marking elements within the source text. Since elements move when editing text, it becomes possible to edit a large number of errors at a time. Error elements are temporary elements and hence vanish automatically when storing a marked Write text.
  40. By clicking on a error element using MM, the element may be toggled between its (initial) compact form and its full form. In the full form, the element displays the corresponding error message. In order for this function to work properly, the files Syntax8.Scn.Fnt and Oberon2Errors.Text are required. The latter contains the error code/error message pairs.
  41. command    explicit parameters    implicit parameters
  42. ErrorElems.Mark    ("^" | error-list)    marked viewer
  43. Takes the list of errors produced by a compiler (position, error code pairs) and inserts error marks into the marked text. If error marks were already present in that text, they are removed beforehand.
  44. ErrorElems.Unmark        marked viewer
  45. Remove all error elements from the marked text.
  46. ErrorElems.LocateNext        marked viewer, caret (in marked viewer)
  47. Locate the next error element starting the search at the caret position. If no caret is set in the marked viewer, the first error element is located.
  48. Fold Elements
  49. Fold Elements can be used to partially and hierarchically fold texts. Folding a text stretch causes its replacement by another, usually shorter or empty text stretch. Unfolding a folded stretch reveils the original text stretch while hiding its replacement. It is possible to unfold or to fold all folds existing in a text. Also, a (partially) folded text may be compiled as if it where fully unfolded using a utility module FoldComp. FoldComp also includes the functionality of ErrorElems, as defined elsewhere in this documentation, but uses a different file Oberon.Errors to translate error codes into error messages. Oberon.Errors also contains the name of the compiler to be used by FoldComp. A demonstration of FoldElems and FoldComp is available as file FoldDemo.Txt. Also, a special tool is available: FoldElems.Tool.
  50. command    explicit parameters    implicit parameters
  51. FoldElems.Insert        selection
  52. Make selection foldable by inserting an appropriate pair of opening and closing fold elements before and after the selected text stretch, respectively.
  53. FoldElems.Expand        marked viewer
  54. Unfolds (expands) all folds contained in the marked text.
  55. FoldElems.Collapse        marked viewer
  56. Folds (collapses) all folds contained in the marked text.
  57. FoldElems.Marks     ("^" | "on" | "off")    marked viewer
  58. Make all fold elements in the marked text visible or invisible.
  59. FoldElems.Search        selection, marked viewer    
  60. Search for the selected text stretch in the (partially) folded marked text starting at the caret position. Does search within folded parts and opens folds if necessary to display found text stretches. If no selection is present, the last search pattern is used again. If no caret is present, the search starts at the text's beginning.
  61. FoldComp.Compile    ("*" [compiler-options])    marked viewer
  62. Compile the marked text containing folds. The compiler is started on the fully expanded view of the text.
  63. FoldComp.ShowError
  64. Show next error after the caret position. If no caret is present, the first error in the marked text is displayed.
  65. Graphics Elements
  66. Graphic elements support incorporation of graphs compatible with the standard Draw package into Write texts. A single command is provided by module GraphicElems in order to insert a new graphics. Using the middle mouse button, a graphics element can be "opened" for editing. As a result, a graphics viewer is opened displaying the graph. The command GraphicElems.Update in the viewer's menu can be used to propagate changes made to the graph back to the graphics element.
  67. command    explicit parameters    implicit parameters
  68. GraphicElems.Insert    ("^" | "*" | name)    caret (plus marked viewer, if "*" is used)
  69. Inserts a graphics element sized to show the graph stored in graphics file "name". If an open graphics viewer is marked, the command can be used to insert all or part of a displayed graph: if a selection exists in the marked graphics viewer's graph, only the selection is copied into the graphics element.
  70. Icon Elements
  71. Display a small "walking sysiphus" icon. By clicking on such an icon using MM, a screen saver is started. Using an icon editor, the file IconElems.Icon may be changed or replaced to install a different animated icon.
  72. command    explicit parameters    implicit parameters
  73. IconElems.Insert        caret
  74. Inserts a new Icon Element at the caret position.
  75. Line Elements
  76. Line elements support horicontal or vertical lines within a Write text. A single command is provided to insert new line elements. The insertion command takes certain parameters such that line elements can be set to automatically adapt in width and height.
  77. command    explicit parameters    implicit parameters
  78. LineElems.Insert    ("^" | ( ("auto" | "tab" | W) ("auto" | H) )    caret
  79. Inserts a line of given or automatically adopted width and height into a Write text. Width and height may be set in units of 1/10 mm. Otherwise, the width may be set to extend to the end of the current line ("auto") or to the next tabulator position ("tab"). The height may be set to equal the paragraphs line height (determined by the parc's line attribute).
  80. Picture Elements
  81. Picture elements support incorporation of pictures compatible with the standard Paint package into Write texts. Using the middle mouse button, a picture element can be "opened" for editing. As a result, a picture viewer is opened displaying the picture. The command PictureElems.Update in the viewer's menu can be used to propagate changes made to the picture back to the picture element.
  82. <to be completed>
  83. command    explicit parameters    implicit parameters
  84. PictElems.Insert    ("^" | name ["scaled"])    caret
  85. Inserts a picture element sized to show the picture stored in picture file "name".
  86. Popup Elements - "Hypertext without Surprises"
  87. Popup elements introduce hypertext features into Write texts.  They have commands associated with them which are executed when the elements are clicked.  A popup element that executes a single command is also called a "button".  Popup Elements are a generalization of the "button" concept found in many hypertext systems in that they present a user with a menu of choices instead of representing only a single command.
  88. A popup element is displayed as a rectangular "button" shape floating in the text.  Clicking MM while the mouse points to a button causes the menu of commands associated with the button to appear on the screen.  The command that was last chosen from this menu is highlighted and offered as a default.  A new command may then be chosen from the menu by moving the mouse over it.  The new command becomes highlighted and is executed when the user releases the middle mouse button.  At any time, the popup action may be cancelled by releasing MM while the mouse is outside of the menu box or by a click of the left mouse button.
  89. Interclicking MR while a menu is displayed opens a menu-edit viewer.  The menu may be edited freely in this viewer.  Any changes are propagated instantly to the menu in question.  Popup elements may be copied freely among Write documents.  Their complete state, including the last command chosen (the next default) are saved to and restored from disk when the associated document is written or opened.
  90. When a menu command is called, Oberon.Par.text is set to the text of the menu.  It is therefore possible to pass parameters to menu commands simply by including them in the menu text.  Oberon.Par.vwr is set to the Viewer displaying the Write document and Oberon.Par.frame to the corresponding frame.
  91. command    explicit parameters    implicit parameters
  92. PopupElems.Insert    string    caret
  93. Inserts a new popup element with an initially empty menu.  The menu associated with the element may be edited in a menu-edit viewer which is opened by clicking MM on the element with MR interclick.  The width of the menu is automatically adjusted to accomodate the widest command, while its line spacing is adjusted automatically to accomodate the largest font in the menu.
  94. Note:  The source is available.  Ed.Open PopupElems.Mod
  95. Style Elements
  96. Style Elements extend standard Write Parcs by adding a name and automatic conformance of equally named parcs within a Write text. For example, a parc named "heading" may be set to format a section heading. Then, all parcs with that name use and maintain the same format as changes are propagated automatically.
  97. When copying a style parc from one text to another the behaviour of the copied parc depends on the target text. If it already contains a style with that name, the copied parc will adopt itself to that style. Otherwise, the copied parc defines a new style. Likewise, a style parc may be renamed. If it is renamed to a style that already exists in the containing text, the parc will adopt to that style, while otherwise it introduces a new style.
  98. Some examples for style parcs follow below. Note that the Syntax8.Scn.Fnt file should be available to get nicely labled style parcs.
  99. command    explicit parameters    implicit parameters
  100. StyleElems.Insert    ("^" | name | string)    caret
  101. Insert a new style parc with the given name at the caret position. A quoted string may be used to assign names consisting of multiple words.
  102. StyleElems.Rename    ("^" | name | string)    selected parc
  103. Renames the selected parc to the given name.
  104. Table Elements
  105. Table Elements are automatically formatted tables created from raw, unformatted data. A plain text separated by tabulator characters into columns and by carriage returns into rows can be used to define the table. Furthermore, a certain set of options may be used to modify the default formatting of the table.
  106. Clicking on a table element using MM opens an viewer such that the table contents can be edited. Tables may contain arbitrary Write elements, including tables. However, elements incorporated into a table are frozen as is, i.e. messages broadcasted to all visible elements in a Write frame are not passed to elements nested into a table. Hence, only static elements should be inserted into tables.
  107. Starting from a defining Write text containing arbitrary strings separated by tabulator and carriage-return characters, a table is constructed. Tabulators separate columns, carriage-returns separate rows. The separated strings form the contents of table cells. Each such string may in turn contain arbitrary Write elements and especially it may contain nested tables. The defining text is bound to a table element and can be edited by clicking on a table with the middle mouse button. In return, a standard Write viewer is opened containing an update command in its menu bar. The syntax of the defining text is as follows, table options will be defined later.
  108.     table = {option} "/table" {line}.
  109.     line = cell {TAB cell} CR.
  110.     cell = ["#" | "&"] <string of characters not containing TAB or CR>.
  111. A string starting with a digit, a period (.), or a sign (+ or -) is considered numeric, otherwise it is considered nonnumeric. A number sign (#) prefixing a string is suppressed and enforces numerical interpretation; likewise, an ampersand (&) prefixing a string is suppressed and enforces nonnumerical interpretation. The default table formatting causes all cells in the first column to be formatted left flush. In all other columns, the default format for numeric cells is period-aligned and that for nonnumeric cells is centered. All cells in a row are by default aligned to a common base line. Also, the default format causes the table to be framed and separating lines between rows and columns to be drawn. Finally, for a table with more than two rows or two columns the first row or column separatation line is drawn using two parallel lines, respectively. Most of the default formats can be changed using the provided option set.
  112. For table elements the printing dilemma discussed in section 1.5 needs to be reconsidered. Following the strategy developed for Write texts, a table would be recasted when printing. However, one of the primary attributes of a table are its measures, i.e. the space taken for individual cells of the table and the arrangement of the cells with respect to each other. It is not acceptable that a table gets completely redimensioned when printed. Hence, for table elements a different printing strategy has been choosen: the displayed table on the screen follows - down to the character level - the metrics of the printer fonts. The resulting screen image looks a bit distorted, however, the displayed measures correspond as closely as possible to the printed ones.
  113. Overview of TableElems Options
  114. command    explicit parameters    implicit parameters
  115. TableElems.Insert    ["^" | name]    caret
  116. Insert a table defined by the given Write text at the caret position. If no defining file is given, an empty table is inserted.
  117. TableElems.Update    (to be called from menu frame)
  118. Take the viewer's content frame's text as defining text and update the associated table element.
  119. load:  Net.ReceiveFiles Pluto    Elems:TableElems.Obj  Elems:WriteFonts.Obj  ~
  120. WriteParcs.Alloc
  121. WriteParcs.Alloc
  122. WriteParcs.Alloc
  123. WriteParcs.Alloc
  124. WriteParcs.Alloc
  125. WriteParcs.Alloc
  126. WriteParcs.Alloc
  127. WriteParcs.Alloc
  128. WriteParcs.Alloc
  129. WriteParcs.Alloc
  130. WriteParcs.Alloc
  131. WriteParcs.Alloc
  132. WriteParcs.Alloc
  133. WriteParcs.Alloc
  134. WriteParcs.Alloc
  135. WriteParcs.Alloc
  136. WriteParcs.Alloc
  137. WriteParcs.Alloc
  138. WriteParcs.Alloc
  139. WriteParcs.Alloc
  140. WriteParcs.Alloc
  141. WriteParcs.Alloc
  142. WriteParcs.Alloc
  143. WriteParcs.Alloc
  144. WriteParcs.Alloc
  145. WriteParcs.Alloc
  146. TableElems.Alloc
  147. Syntax10.Scn.Fnt
  148. /top 8/nohead "v"/noline "vlr"/col "LLL"/row "LCCCCC"/table
  149. option    effect (measures in 1/10 mm)    argument values
  150. /columns  string    
  151. /rows  string    
  152. /noheads  string    
  153. /nolines  string    
  154. WriteParcs.Alloc
  155. WriteParcs.Alloc
  156. TableElems.Alloc
  157. Syntax10.Scn.Fnt
  158. /left 0/right 0/nohead "*"/noline "*"/col "LL"/table
  159. control column formatting
  160. string = {L|C|R|N|-}.
  161. WriteParcs.Alloc
  162. WriteParcs.Alloc
  163. TableElems.Alloc
  164. Syntax10.Scn.Fnt
  165. /left 0/right 0/nohead "*"/noline "*"/col "LL"/table
  166. L    left flush
  167. C    centered
  168. R    right flush
  169. N    numeric (period adjusted)
  170. -    default
  171. WriteParcs.Alloc
  172. WriteParcs.Alloc
  173. TableElems.Alloc
  174. Syntax10.Scn.Fnt
  175. /left 0/right 0/nohead "*"/noline "*"/col "LL"/table
  176. control row formatting
  177. string = {B|L|C|T|-}.
  178. WriteParcs.Alloc
  179. WriteParcs.Alloc
  180. TableElems.Alloc
  181. Syntax10.Scn.Fnt
  182. /left 0/right 0/nohead "*"/noline "*"/col "LL"/table
  183. B    bottom flush
  184. L    common baseline
  185. C    centered
  186. T    top flush
  187. -    default
  188. WriteParcs.Alloc
  189. WriteParcs.Alloc
  190. TableElems.Alloc
  191. Syntax10.Scn.Fnt
  192. /left 0/right 0/nohead "*"/noline "*"/col "LL"/table
  193. turn header lines off
  194. string = {H|V |*}.
  195. WriteParcs.Alloc
  196. WriteParcs.Alloc
  197. TableElems.Alloc
  198. Syntax10.Scn.Fnt
  199. /left 0/right 0/nohead "*"/noline "*"/col "LL"/table
  200. H    horizontal
  201. V    vertical
  202. *    all
  203. WriteParcs.Alloc
  204. WriteParcs.Alloc
  205. TableElems.Alloc
  206. Syntax10.Scn.Fnt
  207. /left 0/right 0/nohead "*"/noline "*"/col "LL"/table
  208. turn separation lines off
  209. string = {L|R|B|T|H|V|*}.
  210. WriteParcs.Alloc
  211. WriteParcs.Alloc
  212. TableElems.Alloc
  213. Syntax10.Scn.Fnt
  214. /left 0/right 0/nohead "*"/noline "*"/col "LL"/table
  215. L    left frame
  216. R    right frame
  217. B    bottom frame
  218. T    top frame
  219. H    horizontal separation
  220. V    vertical separation
  221. *    all
  222. WriteParcs.Alloc
  223. WriteParcs.Alloc
  224. TableElems.Alloc
  225. Syntax10.Scn.Fnt
  226. /left 0/right 0/nohead "*"/noline "*"/table
  227. /period  string
  228. /left  integer
  229. /right  integer
  230. /bottom  integer
  231. /top  integer
  232. /grid  integer
  233. WriteParcs.Alloc
  234. WriteParcs.Alloc
  235. TableElems.Alloc
  236. Syntax10.Scn.Fnt
  237. /left 0/right 0/nohead "*"/noline "*"/table
  238. first char redefines period (e.g. ",")
  239. left cell margin
  240. right cell margin
  241. bottom cell margin
  242. top cell margin
  243. cell width grid *)
  244. WriteParcs.Alloc
  245. WriteParcs.Alloc
  246. TableElems.Alloc
  247. Syntax10.Scn.Fnt
  248. /noheads "*"/nolines "*"/col "RL"/table
  249. *)    A parc at the beginning of the table defining text introduces a minimal                          
  250.     cell height as well as a cell height grid (if the grid option of the parc is set)
  251. WriteParcs.Alloc
  252. WriteParcs.Alloc
  253.